<template>
  <!-- 患者结算页面 -->
  <div class="page-container">
    <el-card class="main-card">
      <template #header>
        <span class="main-title">患者结算</span>
      </template>
      <!-- 待结算患者表格 -->
      <el-table :data="patients" style="width: 100%; margin-top: 16px;" stripe highlight-current-row>
        <el-table-column type="index" label="序号" width="80" align="center" />
        <el-table-column prop="name" label="姓名" width="100" />
        <el-table-column prop="idCard" label="身份证号" width="180" />
        <el-table-column prop="fee" label="应结算费用(元)" width="120" />
        <el-table-column prop="status" label="状态" width="100">
          <template #default="scope">
            <el-tag :type="scope.row.status === '已结算' ? 'success' : 'info'">{{ scope.row.status }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="120">
          <template #default="scope">
            <el-button size="small" type="primary" :disabled="scope.row.status === '已结算'" @click="settle(scope.$index)" class="main-btn">结算</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
// 待结算患者数据（前端模拟）
const patients = ref([
  { name: '张三', idCard: '110101199001011234', fee: 120, status: '未结算' },
  { name: '李四', idCard: '120101199202025678', fee: 80, status: '未结算' },
  { name: '王五', idCard: '130101198503034321', fee: 60, status: '已结算' }
])
// 结算操作
function settle(index) {
  patients.value[index].status = '已结算'
  ElMessage.success('结算成功')
}
</script>

<style scoped>
.page-container {
  padding: 32px;
  background: linear-gradient(135deg, #e3f0ff 0%, #f5f7fa 100%);
  min-height: 100vh;
}
.main-card {
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(80,120,200,0.10), 0 1.5px 8px 0 rgba(80,120,200,0.08);
  transition: box-shadow 0.3s;
}
.main-card:hover {
  box-shadow: 0 12px 40px 0 rgba(80,120,200,0.16), 0 2px 12px 0 rgba(80,120,200,0.10);
}
.main-title {
  font-size: 22px;
  font-weight: 600;
  color: #1976d2;
  letter-spacing: 1px;
}
.main-btn {
  border-radius: 8px;
  background: linear-gradient(90deg, #42a5f5 0%, #1976d2 100%);
  font-weight: 600;
  letter-spacing: 1px;
  border: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.main-btn:hover {
  background: linear-gradient(90deg, #1976d2 0%, #42a5f5 100%);
  box-shadow: 0 4px 16px 0 rgba(33,150,243,0.12);
}
.el-table {
  border-radius: 10px;
  overflow: hidden;
}
.el-table__row:hover {
  background: #e3f2fd !important;
}
</style> 